// ReferenceError: Cannot access 'message' before initialization
// console.log(message)

// 1、使用 let 声明变量
let message = "Hello World";
console.log(message)

message = 10000;
console.log(message)

// 2、let 声明变量作用域更合理
function doSth() {
    let age = 10;
    console.log(age)
}

doSth();

// ReferenceError: age is not defined
// console.log("age = " + age)

// 3、使用 const 声明常量
const PI = 3.14;
console.log("PI = " + PI);

// TypeError: Assignment to constant variable.
// PI = 6.28;

const ANIMAL_ARR = ["dog", "pig", "rabbit", "tiger"];
ANIMAL_ARR[4] = "sheep";
console.log(ANIMAL_ARR)

// 4、模板字符串
let info = `Hello boy!
Good morning!
I love you!
`;
console.log(info)

let stuName = "tom";
let age = 1000;
info = `Hi ${stuName},Today is a good day!${age}`;
console.log(info)